<?php
/* @var $this SiteController */

if (Yii::app()->session["user_id"] == null) {
    $this->redirect(array("site/index"));
}
$this->pageTitle = Yii::app()->name;
?>
<?php $form = $this->beginWidget('CActiveForm', array()); ?>
<?php echo $form->errorSummary($user); ?>
<?php if (Yii::app()->session["user_status"] == "Administrator"): ?>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "userid"); ?>
        <?php echo $form->textField($user, "userid"); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "id_member"); ?>
        <?php echo $form->textField($user, "id_member"); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "id_card"); ?>
        <?php echo $form->textField($user, "id_card"); ?>
    </div>
<?php endif ?>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "a_head_t"); ?>
    <?php echo $form->dropDownList($user, 'a_head_t', Userlog::listTypeEmpTha(), array('empty' => 'Select...')); ?>      
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "f_name"); ?>
    <?php echo $form->textField($user, "f_name"); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "l_name"); ?>
    <?php echo $form->textField($user, "l_name"); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "a_head_e"); ?>
    <?php echo $form->dropDownList($user, 'a_head_e', Userlog::listTypeEmpEng(), array('empty' => 'Select...')); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "f_name_e"); ?>
    <?php echo $form->textField($user, "f_name_e"); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "l_name_e"); ?>
    <?php echo $form->textField($user, "l_name_e"); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "user_sex"); ?>
    <?php echo $form->dropDownList($user, 'user_sex', Userlog::listTypeEmpSex(), array('empty' => 'Select...')); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "address"); ?>
    <?php echo $form->textArea($user, "address"); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "phone"); ?>
    <?php echo $form->textField($user, "phone"); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "i_email"); ?>
    <?php echo $form->textField($user, "i_email"); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "x_email"); ?>
    <?php echo $form->textField($user, "x_email"); ?>
</div>
<?php if (Yii::app()->session["user_status"] == "Administrator"): ?>

    <div class="panel_body2">
        <?php echo $form->labelEx($user, "date_inwork"); ?>
        <?php echo $form->textField($user, "date_inwork"); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "position"); ?>
        <?php echo $form->textField($user, "position"); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "departid"); ?>
        <?php echo $form->dropDownList($user, 'departid', Userlog::listDepart(), array('empty' => 'Select...')); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "worktime"); ?>
        <?php echo $form->textField($user, "worktime"); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "status"); ?>
        <?php echo $form->dropDownList($user, 'status', Userlog::listTypeEmpStatus(), array('empty' => 'Select...')); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "send_letter"); ?>
        <?php echo $form->dropDownList($user, 'send_letter', Userlog::listTypeEmpLetter(), array('empty' => 'Select...')); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "active_works"); ?>
        <?php echo $form->dropDownList($user, 'active_works', Userlog::listTypeEmpWorks(), array('empty' => 'Select...')); ?>
    </div>
    <div class="panel_body2">
        <?php echo $form->labelEx($user, "type_emp"); ?>
        <?php echo $form->dropDownList($user, 'type_emp', Userlog::listTypeEmpType(), array('empty' => 'Select...')); ?>
    </div>
<?php endif ?>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "userlog"); ?>
    <?php echo $form->textField($user, "userlog"); ?>
</div>
<div class="panel_body2">
    <?php echo $form->labelEx($user, "passlog"); ?>
    <?php echo $form->passwordField($user, "passlog"); ?>
</div>
<div class="panel_body2" >
    <?php echo $form->hiddenField($user, "id") ?>
    <input type="submit" value="บันทึก" />
</div>
<?php $this->endWidget(); ?>